package com.niuwa.p2p.action.customer;

import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.niuwa.p2p.action.JsonAction;
import com.niuwa.p2p.core.mvc.entity.PageBean;
import com.niuwa.p2p.service.customer.ICustomerService;
import com.niuwa.p2p.vo.customer.BaseInvestVo;

@Controller
public class BaseInvestAction extends JsonAction{

	// 资源Service spring扫包注入 /
	@Autowired
	private ICustomerService customerService;
	
	@Action("gotoInvestList")
	public String gotoInvestList() {
		return "investList";
	}
	
	/**
	 * 投资列表
	 * 
	 * @return
	 * @throws Exception
	 */
	@Action(value = "invest")
	public String investList() throws Exception {
		setObjectReSult(queryPagination());
		return NONE;
	}

	/**
	 * 投资列表分页查询
	 * @return
	 */
	private PageBean<BaseInvestVo> queryPagination() {
		// 获取查询参数
		Map<String, Object> paramMap = getParamMap();
		// 执行查询操作
		PageBean<BaseInvestVo> pagination = customerService.selectInvest(paramMap);
		return pagination;
	}
	
}
